#include "SQAlgo.hpp"
#include "queue.hpp"
#include "stack.hpp"
#include "tools.hpp"

#include <cstdio>
#include <cstdlib>

int main()
{
    lxj::Time         time;
    lxj::Random<int>& rand = lxj::Random<int>::instance();

    lxj::MinStack<4> sq;
    for (int i = 0; i < 20; i++) {
        if (rand(0, 1) == 0) {
            const char* const b = sq.pop() == true ? "true" : "false";
            std::printf(b);
            std::printf("    :pop");
        }
        else {
            const char* const b = sq.push(rand(1, 9)) == true ? "true" : "false";
            std::printf(b);
            std::printf("    :push");
        }
        int min_value = sq.getMin();
        std::printf("    --: %d\n", min_value);
    }

    return 0;
}